$(function(){
		var path = "/OA"
		console.log("hello");
		$("#btn").click(function(){
			$.ajax({
				url :path + "/user/login",
				data:{"loginname":$("#loginname").val() , "password" : $("#password").val()},
				dataType:"json",
				error:function(){
					alert("系统错误");
				},
				success:function(data){
					if(data.success){
						alert(data.message);
						if(data.object.rolename =="系统超级管理员" || data.object.rolename == "普通管理员"){
							window.open("/OA/index/toIndex","_self");
						}else{
							window.open("/OA/main/toIndex","_self");
						}
						
					}else{
						alert(data.message);
						console.log(data);
					}
				}
			});
		});
	});